{% extends "base.volt" %}

{% block pageHeader %}
    {{ stylesheet_link("/libs/bootstrap-daterangepicker/daterangepicker.css", false) }}
    <style>
        .tabs { display: none;}

    </style>
    
{% endblock %}

{% block pageFooter%}
<script type="text/javascript">
        var domainPic = '{{ this.di.get('appConfig').application.domainPic }}';
        var urlEditorPT = '{{ url.get('tools/editorPT') }}';
        var urlList = '{{ url.get('om/advertisementList') }}';
    </script>
    {{ javascript_include("/assets/manage/js/editor_pt_view.js", false) }}
    {{ javascript_include("/libs/bootstrap-daterangepicker/moment.min.js", false) }}
    {{ javascript_include("/libs/bootstrap-daterangepicker/daterangepicker.js", false) }}
		
    <script type="text/javascript" charset="utf-8" src="/libs/UEditor/utf8-php/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/libs/UEditor/utf8-php/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="/libs/UEditor/utf8-php/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" charset="utf-8" src="/libs/UEditor/utf8-php/addCustomizeButton.js"></script>
    {{ javascript_include("/assets/manage/js/om/advertisementAdd.js", false) }}
    
{% endblock %}

{% block content %}
    {{ partial("module/left_om") }}
    <div class="col-xs-10">
        <ol class="breadcrumb">
            <li>广告位管理</li>
            <li class="active">添加广告位</li>
        </ol>
           
       <form id="form_add"  class="form-horizontal" role="form" method="post" urlList="{{url.get('om/advertisementList')}}" action="" target="ifr_send_file" enctype="multipart/form-data">
            <input type="hidden" name="callback" value="parent.setFormResult">
            <!-- <div class="form-group">
            	<label for="bp_is_sell" class="col-xs-2 control-label">城市</label>
            	<div class="col-xs-9">
                	<select class="form-control" name="filterCity" id="filterCity">
                                <option value="0" {{ filterCity == 0 ? 'selected="selected"' : '' }}>全国</option>
                                {% for oc in openCity %}
                                    <option value="{{ oc.city_id }}" {{ filterCity == oc.city_id ? 'selected="selected"' : '' }} >{{ oc.city_name|e }}</option>
                                {% endfor %}
                    </select>
            	</div>
            </div> -->	
            <div class="form-group">
            	<label for="bp_is_sell" class="col-xs-2 control-label">城市</label>
            	<div class="col-xs-9">
                	<div class="checkbox">
                        <label class="checkbox-inline">
                		    <input type="checkbox" name="city[]" id="cityAll" value="0" > 全国
                        </label>
                		{% for oc in openCity %}
                    	<label class="checkbox-inline">
                        	<input type="checkbox" name="city[]" id="city" value="{{ oc.city_id }}"> {{ oc.city_name|e }}
                    	</label>
                		{% endfor %}
                	</div>
            	</div>
        	</div>
        	<div class="form-group">
            	<label class="col-xs-2 control-label" for="">位置</label>
        		<div class="col-xs-9">
                	<select class="form-control" name="position" id="position">
                		<option value="0">请选择</option>
                    	<option value="1">通栏一</option>
                    	<option value="2">通栏二</option>
                    	<option value="3">通栏三</option>
                	</select>
                </div>            
           </div>
            <div class="form-group">
                <label for="activity_title" class="col-xs-2 control-label">标题</label>
                <div class="col-xs-9">
                    <input type="text" class="form-control" id="advertisement_title" name="advertisement_title" data-rule="required;">
                </div>
            </div>
            
            <div class="form-group">
                <label for="activity_cover" class="col-xs-2 control-label">封面</label>
                <div class="col-xs-9">                 
                    <input type="file" class="form-control" id="advertisement_cover" name="advertisement_cover" data-rule="required;">
                    <p id="imgInfo" class="help-block">*支持JPG，PNG，JPEG格式的图片，大小不超过1M，尺寸为：750X200px</p>
                </div>
            </div>
            <div class="form-group">
                <label for="advertisement_intro" class="col-xs-2 control-label">详情介绍</label>
                <div>
                	<input id="intro1" name="type" type="radio" value="1" checked="checked">图文介绍
                    <input id="intro2" name="type" type="radio" value="2" >外链地址
                </div>
                
                <div id="intro11" class="col-xs-9">		    
    				<textarea id="editor" style="width:600px;height:300px;" name="advertisement_intro" data-rule="required;">
    				</textarea>  				
				</div>               
            </div>
            
            
            <div id="intro22" class="form-group" style="display:none">
                <label for="out_link" class="col-xs-2 control-label">外链地址</label>
                <div class="col-xs-5">
                    <input type="text" class="form-control" value="{{d.out_link}}" id="out_link" name="out_link" data-rule="required;">
                    <p class="help-block">如要链接到美容院，则填写美容院预览地址</p>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-12 text-center">
                    <button id="btn_save" type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
                </div>
            </div>
        </form>
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
<!--
        <form id="form_add" class="form-horizontal" role="form" method="post" action="" target="ifr_send_file" enctype="multipart/form-data">
            <input type="hidden" name="callback" value="parent.setFormResult">
            <input type="hidden" name="activity_type" value="1">
            <div class="form-group">
                <label for="activity_title" class="col-xs-2 control-label">标题</label>
                <div class="col-xs-9">
                    <input type="text" class="form-control" id="activity_title" name="activity_title" data-rule="required;">
                </div>
            </div>
            <div class="form-group">
                <label for="city_id" class="col-xs-2 control-label">城市</label>
                <div class="col-xs-2">
                    <select class="form-control" id="city_id" name="city_id" data-rule="required;">
                    {% for oc in openCity %}
                        <option value="{{ oc.city_id }}">{{ oc.city_name|e }}</option>
                    {% endfor %}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="activity_cover" class="col-xs-2 control-label">封面</label>
                <div class="col-xs-9">
                    <input type="file" class="form-control" id="activity_cover" name="activity_cover" data-rule="required;">
                    <p class="help-block">图片高宽都必须是：750x220px，大小不得超过2M</p>
                </div>
            </div>
            <div class="form-group">
                <label for="activity_cover" class="col-xs-2 control-label">活动周期</label>
                <div class="col-xs-5">
                    <input type="text" class="form-control" id="activity_time" name="activity_time" data-rule="required;" readonly="readonly">
                </div>
            </div>
            <div class="form-group">
                <label for="activity_intro" class="col-xs-2 control-label">活动介绍</label>
                <div class="col-xs-9">
                    <div id="box_intro_view" class="hide"></div>
                    <input type="hidden" class="form-control" id="activity_intro" name="activity_intro" data-rule="required;" data-target="#activity_intro_error">
                    <button type="button" class="btn btn-primary btn-sm" id="but_intro_add"><i class="fa fa-plus"></i> 添 加</button>
                    <button type="button" class="btn btn-primary btn-sm hide" id="but_intro_update"><i class="fa fa-pencil"></i> 修 改</button>
                    <div class="input-group" id="activity_intro_error"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-12 text-center">
                    <button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
                </div>
            </div>
        </form>
       -->
    </div>
    
    
    
{% endblock %}